<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title>个人申请详情</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../common/mui/mui.css" rel="stylesheet" />
		<link href="../../common/css/yahei.css" rel="stylesheet" />
		<link href="../../common/css/iconfont.css" rel="stylesheet" />
		<link href="../../common/css/app.css" rel="stylesheet" />
		<link href="../../dependence/wkplatform/css/ky/kyDetail.css" rel="stylesheet" />
	</head>

	<body class="YaHei">
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">详情</h1>
		</header>
		<div class="mui-content">
			<div class="headArea">
				<div id="applyer" class="headTitle mui-ellipsis">申请人 备案</div>
				<div id="appLoc" class="headLine mui-ellipsis">申请科室：</div>
				<div id="appDate" class="headLine mui-ellipsis">提交时间：</div>
				<div id="statusIcon" class="statusIcon"><div class=""></div></div>
			</div>
			<div id="wrapper" class="mui-scroll-wrapper">
				<div id="scroll" class="mui-scroll mui-scroll-phone">
					<ul id="middleUL" class="mui-table-view"></ul>
					<ul id="processUL" class="mui-table-view"></ul>
				</div>
			</div>
		</div>
		<script src="../../common/mui/mui.js"></script>
		<script src="../../common/js/jquery-3.4.1.min.js"></script>
		<script src="../../common/js/globalSet.js"></script>
		<script src="../../common/js/DHCWebService.js"></script>
		<script type="text/javascript">
	var pageType,imgSrc,method,id;
	mui.init();
	mui.plusReady(function() {
		baseSetup();
	})
	if (!mui.os.plus) {
		baseSetup()
	}
function getDetailData(){
		var pdict = {'id':id}
		var paramDict = {'method':method,'params':JSON.stringify(pdict),'type':'RecMethod'}
		mui.DHCWebService(paramDict, function(result) {
			//console.log(JSON.stringify(result))
			var dataArr = result.data
			updateUI(dataArr)
		}, function(errorStr) {
		 	
		});
	}
	
	//
	function updateUI(dict){
		var Status = dict['Status']; //N:保存 S:提交 A:审核 B:驳回
		if (pageType == '换班申请') { //B:驳回 Y:提交 A:审核
			Status = dict['ExchangeStatus']
		}else if (pageType == '改班申请') {
			Status = dict['ChangeStatus']
		}
		var statusIcon = 'nur-status'+Status
		if (Status == 'S' || Status == 'Y') {
			statusIcon = 'nur-statusR'
		}
		mui('#statusIcon')[0].innerHTML = '<div class="nurfont '+statusIcon+'"></div>'
		mui('#appDate')[0].innerHTML = '提交时间：'+dealUndefined(dict['CreateDate'])+' '+dealUndefined(dict['CreateTime'])
		var approveClass = 'dealing'
		var approveText = '审核中'
		var approveIcon = 'nur-zanting'
		if (Status == 'B') {
			approveText = '审核不通过'
			approveClass = 'refuse'
			approveIcon = 'nur-error'
		}else if (Status == 'A') {
			approveClass = 'pass';
			approveText = '审核通过';
			approveIcon = 'nur-correct'
		}
		var AuditOpinion = dict['AuditOpinion']==undefined?"":dict['AuditOpinion']
		var auditorHtml = '<li class="mui-table-view-cell '+approveClass+'">'+
			'<div class="processIcon"><div class="nurfont '+approveIcon+'"></div></div>'+
			'<div class="oneline">'+
				'<div class="dealName mui-ellipsis">'+ dict['AuditorName']+'  '+approveText+'</div>'+
				'<div class="dealDate">'+dealUndefined(dict['AuditDate'])+' '+dealUndefined(dict['AuditTime'])+'</div>'+
			'</div>'+
			'<div class="dealLoc mui-ellipsis">'+AuditOpinion+'</div>'+
		'</li>';
			
		
		if (pageType == '意愿排班') {
			mui('#applyer')[0].innerHTML = dict['PerName'] + ' ' +pageType
			mui('#appLoc')[0].innerHTML = '申请科室：'+dict['WardDesc']
			var htmls = '<li class="mui-table-view-cell"><div class="leftText">班次：</div><div class="rightText">'+dict['PostDesc']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">日期：</div><div class="rightText">'+dict['WishDate']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">备注：</div><div class="rightText">'+dict['Remark']+'</div></li>'
			mui('#middleUL')[0].innerHTML = htmls
			var processHtml = auditorHtml+'<li class="mui-table-view-cell">'+
					'<div class="processIcon"><div class="nurfont nur-nocheck"></div></div>'+
					'<div class="oneline">'+
						'<div class="dealName mui-ellipsis">'+ dict['PerName']+'  提交</div>'+
						'<div class="dealDate">'+dealUndefined(dict['CreateDate'])+' '+
							dealUndefined(dict['CreateTime'])+'</div>'+
					'</div>'+
					'<div class="dealLoc mui-ellipsis">'+dict['WardDesc']+'</div>'+
				'</li>'
			mui('#processUL')[0].innerHTML = processHtml
			return
		}
		
		if (pageType == '换班申请') {
			mui('#applyer')[0].innerHTML = dict['ExchangeFromNurseName'] + ' ' +pageType
			mui('#appLoc')[0].innerHTML = '申请科室：'+dict['ExchangeWardDesc']
			var htmls = '<li class="mui-table-view-cell"><div class="leftText">申请日期：</div><div class="rightText">'+dict['ExchangeFromArgDate']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">申请班次：</div><div class="rightText">'+dict['ExchangeFromArgDesc']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">换班日期：</div><div class="rightText">'+dict['ExchangeToArgDate']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">换班对象：</div><div class="rightText">'+dict['ExchangeToNurseName']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">换班班次：</div><div class="rightText">'+dict['ExchangeToArgDesc']+'</div></li>'
			
			mui('#middleUL')[0].innerHTML = htmls
			var processHtml = auditorHtml+'<li class="mui-table-view-cell">'+
					'<div class="processIcon"><div class="nurfont nur-nocheck"></div></div>'+
					'<div class="oneline">'+
						'<div class="dealName mui-ellipsis">'+ dict['ExchangeFromNurseName']+'  提交</div>'+
						'<div class="dealDate">'+dict['CreateDate']+' '+dict['CreateTime']+'</div>'+
					'</div>'+
					'<div class="dealLoc mui-ellipsis">'+dict['ExchangeWardDesc']+'</div>'+
				'</li>'
			mui('#processUL')[0].innerHTML = processHtml
			return
		}
		if (pageType == '改班申请') {
			mui('#applyer')[0].innerHTML = dict['ChangeNurseName'] + ' ' +pageType
			mui('#appLoc')[0].innerHTML = '申请科室：'+dict['ChangeWardDesc']
			var htmls = '<li class="mui-table-view-cell"><div class="leftText">改班日期：</div><div class="rightText">'+dict['ChangeSourceDate']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">改班班次：</div><div class="rightText">'+dict['ChangeFromPostDesc']+'</div></li>'+
				'<li class="mui-table-view-cell"><div class="leftText">期望班次：</div><div class="rightText">'+dict['ChangeToPostDesc']+'</div></li>'
			
			mui('#middleUL')[0].innerHTML = htmls
			var processHtml = auditorHtml+'<li class="mui-table-view-cell">'+
					'<div class="processIcon"><div class="nurfont nur-nocheck"></div></div>'+
					'<div class="oneline">'+
						'<div class="dealName mui-ellipsis">'+ dict['ChangeNurseName']+'  提交</div>'+
						'<div class="dealDate">'+dict['CreateDate']+' '+dict['CreateTime']+'</div>'+
					'</div>'+
					'<div class="dealLoc mui-ellipsis">'+dict['ChangeWardDesc']+'</div>'+
				'</li>'
			mui('#processUL')[0].innerHTML = processHtml
			return
		}
	}
	
	function baseSetup(){
		mui('.mui-scroll-wrapper').scroll({
			bounce: true,
			indicators: false, //是否显示滚动条
		});
		var self = plus.webview.currentWebview()
		pageType = self.title
		imgSrc = self.imgSrc
		id = self.rw
		switch (pageType){
			case '意愿排班':
				method = 'web.INMArgComm:getWishArrange'
				break;
			case '换班申请':
				method = 'web.INMArgComm:GetExchangeApp'
				break;
			case '改班申请':
				method = 'web.INMArgComm:GetChangeApp'
				break;
			default:
				break;
		}
		mui('.mui-title')[0].innerText = pageType
		getDetailData();
	}
	function dealUndefined(str){
		if (str == undefined || str == null) {
			return ''
		}
		return str
	}
/*
意愿排班
{"ArgTime":"07:30-11:30;14:0018:00","AuditDate":"","Auditor":"","AuditorName":"","PerDR":"698","PerName":"刘亭婷","PostDR":"69","PostDesc":"P",
"Remark":"备注","Status":"S","StatusDesc":"已提交","WardDR":"29","WardDesc":"内分泌科护理单元","WishDate":"2022-04-25","rw":"20"}

换班申请
{"AuditDate":"","AuditOpinion":"","AuditTime":"","Auditor":"","AuditorName":"","CreateDate":"2022-04-26","CreateTime":"10:47:51","ExchangeFromArg":"5515",
"ExchangeFromArgDate":"2022-02-15","ExchangeFromArgDesc":"A","ExchangeFromNurse":"698","ExchangeFromNurseName":"刘亭婷","ExchangeStatus":"Y",
"ExchangeStatusDesc":"提交","ExchangeToArg":"5453","ExchangeToArgDate":"2022-02-15","ExchangeToArgDesc":"P","ExchangeToNurse":"681",
"ExchangeToNurseName":"张乐晗","ExchangeWard":"29","ExchangeWardDesc":"内分泌科护理单元","rw":"13"}

*/ 

		</script>
	</body>

</html>

